package com.fitso.model.dao;

import org.joda.time.DateTime;

import com.fitso.model.bean.User;
import com.fitso.model.bean.journal.FoodJournal;
import com.fitso.model.bean.journal.FoodJournalEntry;

public interface FoodJournalDao {
	/**
	 * <p>
	 * Finds a {@link FoodJournal} for the given user and date. Implementations
	 * should only focus on year, month and date. So if the date/time is
	 * 2009.02.15 12:30:44 PM then the date parameter should only search on
	 * 2009.02.15.
	 * </p>
	 * 
	 * @param user
	 * @param date
	 * @return food journal for the given user and date
	 */
	FoodJournal read(User user, DateTime date);

	/**
	 * <p>
	 * Saves new or updates changed {@Link FoodJournalEntry}s of the
	 * {@link FoodJournal}
	 * </p>
	 * 
	 * @param journal
	 */
	void createOrUpdate(FoodJournal journal);

	/**
	 * <p>
	 * Deletes {@link FoodJournalEntry}s of the given {@link FoodJournal}
	 * </p>
	 * 
	 * @param journal
	 */
	void delete(FoodJournal journal);
}
